package demo16;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        int n=sr.nextInt();
        if (n<=120&&n>=0){
            System.out.println(n*20);
        }else{
            System.out.println(120*20+(n-120)*40);
        }
    }
}
